package logic

import (
	study "0411zk/common/proto"
	"0411zk/rpc/sever"
	"context"
)

type ServiceStudy struct {
	study.UnimplementedStudyServer
}

func (s ServiceStudy) UserRegister(ctx context.Context, req *study.UserRegisterReq) (*study.UserRegisterResp, error) {
	register, err := sever.UserRegister(req)
	if err != nil {
		return nil, err
	}
	return register, nil
}
func (s ServiceStudy) BrowseCourses(ctx context.Context, req *study.BrowseCoursesReq) (*study.BrowseCoursesResp, error) {
	register, err := sever.BrowseCourses(req)
	if err != nil {
		return nil, err
	}
	return register, nil
}

func (s ServiceStudy) BrowseCoursesAdd(ctx context.Context, req *study.BrowseCoursesAddReq) (*study.BrowseCoursesAddResp, error) {
	register, err := sever.BrowseCoursesAdd(req)
	if err != nil {
		return nil, err
	}
	return register, nil
}

func (s ServiceStudy) BrowseCoursesDel(ctx context.Context, req *study.BrowseCoursesDelReq) (*study.BrowseCoursesDelResp, error) {
	register, err := sever.BrowseCoursesDel(req)
	if err != nil {
		return nil, err
	}
	return register, nil
}

func (s ServiceStudy) CoursesOrder(ctx context.Context, req *study.CoursesOrderReq) (*study.CoursesOrderResp, error) {
	register, err := sever.CoursesOrder(req)
	if err != nil {
		return nil, err
	}
	return register, nil
}
